<%--

  Licensed under the GNU LESSER GENERAL PUBLIC LICENSE, version 2.1, dated February 1999.

  This program is free software; you can redistribute it and/or modify
  it under the terms of the latest version of the GNU Lesser General
  Public License as published by the Free Software Foundation;

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU Lesser General Public License for more details.

  You should have received a copy of the GNU Lesser General Public License
  along with this program (LICENSE.txt); if not, write to the Free Software
  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

--%>
<%@ page errorPage="/WEB-INF/jsp/error.jsp"
    contentType="text/html; charset=utf-8"
%>

<%
String path1 = request.getContextPath(); 
String basePath1 = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path1+"/";
 %>
<script type="text/javascript">
<!--
  function searchHistory(){
     searchForm.action = "<%=path1 %>/en/Special:History";
     searchForm.submit();
  }
//-->
</script>
<script language="javascript" type="text/javascript" src="<%=basePath1%>/js/My97DatePicker/WdatePicker.js"></script>
<%@ include file="page-init.jsp" %>
<%@ page import="org.jamwiki.model.*,org.jamwiki.utils.*" %>
 
     <table width="98%" border="0" cellspacing="0" cellpadding="0">
         <tr>
           <td width="0" class="word-orange" align="left"><%@ include file="navigation-menu.jsp" %></td>   
           </tr>  
           <tr><td width="0" class="word-orange" align="center"> <%@ include file="top-menu.jsp" %></td></tr>
      </table>
       <form name="searchForm" method="post" action="" />
        <table width="96%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="50%" align="left">发布日期自
              <label>
              <input type="hidden" name="topic" value='<c:out value="${pageInfo.topicName}"/>'/>
              <input class="Wdate" id="bdate" name="bdate" value="<%=request.getAttribute("bdate")==null?"":request.getAttribute("bdate") %>" type="text" onfocus="new WdatePicker(this,'%Y-%M-%D',false)" MAXDATE="#F{$('edate').value}"/>至
              <input class="Wdate" id="edate" name="edate" value="<%=request.getAttribute("edate")==null?"":request.getAttribute("edate") %>" type="text" onfocus="new WdatePicker(this,'%Y-%M-%D',false)" MINDATE="#F{$('bdate').value}" MAXDATE="2020-1-1"/>
              &nbsp;&nbsp;&nbsp;<input type="image" src="<%=imagePath %>ico-search.gif" width="17" height="17" onclick="searchHistory();"  align="absmiddle" /></label></td>
          </tr>
        </table>
        </form>
     <table width="98%" border="0"><tr><td>
		 <div id="change" align="left">
		<form action="<jamwiki:link value="Special:History" />" method="get" name="historyForm">
		<input type="hidden" name="topic" value='<c:out value="${pageInfo.topicName}"/>'/>
		</form>
		<form action="<jamwiki:link value="Special:Diff" />" method="get" name="diffForm">
		<input type="hidden" name="topic" value='<c:out value="${pageInfo.topicName}" />' />
		<c:if test="${numChanges > 1}">
		<input type="submit" value='<f:message key="history.diff" />' />
		</c:if>
	  <%int  i=1; %>
	  <table width="98%"  border="0"  cellpadding="0" cellspacing="1" bgcolor="#dddddd">
	    <tr><td width="14%" class="table-title" align="center">差异比较</td><td width="4%" class="table-title" >&nbsp;</td><td width="28%" class="table-title" align="center">知识标题</td><td width="17%" class="table-title" align="center">发布时间</td><td width="17%" class="table-title" align="center">发布人</td><td width="20%" class="table-title" align="center">操作</td></tr>
		<c:forEach items="${changes}" var="change" varStatus="status">
		    <tr style="display:none"><td><%=i++ %></td></tr>
            <tr  class="<%if(i%2==0){ %>table-tr1<%}else{ %>table-tr2<%} %>">
            <td width="14%" align="left">
                <c:if test="${numChanges > 1}">
				&#160;
				<input type="radio" name="version2" id="ver2_<c:out value="${change.topicVersionId}" />" onclick="historyRadio(this, 'version1', true)" value="<c:out value="${change.topicVersionId}" />" <c:if test="${status.index == 1}">checked="checked"</c:if> <c:if test="${status.first}">style="visibility:hidden"</c:if> />
				&#160;
				<input type="radio" name="version1" id="ver1_<c:out value="${change.topicVersionId}" />" onclick="historyRadio(this, 'version2', false)" value="<c:out value="${change.topicVersionId}" />" <c:if test="${status.first}">checked="checked"</c:if> <c:if test="${status.last}">style="visibility:hidden"</c:if> />
				</c:if>
            </td>
            <td width="4%" height="25" align="center"  ><img src="<%=imagePath %>Forum_readme.gif" width="10" height="10"></td>
            <td width="28%" align="left"  >
            <jamwiki:link value="Special:History"><jamwiki:linkParam key="topicVersionId" value="${change.topicVersionId}" /><jamwiki:linkParam key="topic" value="${pageInfo.topicName}" /><c:out value="${pageInfo.simpleName}" /></jamwiki:link>
            </td>
            <td width="17%" align="center" ><jamwiki:link value="Special:History"><jamwiki:linkParam key="topicVersionId" value="${change.topicVersionId}" /><jamwiki:linkParam key="topic" value="${pageInfo.topicName}" /><f:formatDate value="${change.editDate}" type="both" pattern="yyyy-MM-dd" /></jamwiki:link></td>
            <td width="17%" align="center" >${change.authorName}<!--  <jamwiki:link value="User:${change.authorName}" text="${change.authorName}" />--></td>
            <td width="20%" align="center"  class="txt-blue">
             <jamwiki:link value="${pageInfo.topicName}?show=false"><f:message key="recentchanges.caption.comments" /></jamwiki:link>&#160;|&#160;<jamwiki:link value="Special:Contributions"><jamwiki:linkParam key="contributor" value="${change.authorName}" /><f:message key="recentchanges.caption.contributions" /></jamwiki:link>
			 <c:if test="${!empty change.changeTypeNotification}">&#160;<b><c:out value="${change.changeTypeNotification}" /></b></c:if>
			 <c:if test="${!empty change.editComment}">
             
            </td>
          </tr>
       
		
			</c:if>
		</c:forEach>
		 </table>
		
		<c:if test="${numChanges > 1}">
		<script type="text/javascript">
		historyRadio(document.getElementById('ver2_<c:out value="${changes[1].topicVersionId}" />'), 'version1', true)
		</script>
		</c:if>

		<c:if test="${numChanges > 1}">
		<input type="submit" value='<f:message key="history.diff"/>'/>
		</c:if>
		
		</form>
		<div class="message"><f:message key="common.caption.view" />: <jamwiki:pagination total="${numChanges}" rootUrl="Special:History?topic=${pageInfo.topicName}" /></div>
		</div>
		</td></tr></table>
  

